
#include <stdio.h>

#define MAX 1024

//通过位图的方式定义信号
#define NONE_FLUSH (1 << 0)
#define LINE_FLUSH (1 << 1)
#define FULL_FLUSH (1 << 2)

typedef struct IO_FILE
{
    int fileno;//文件描述符
    int flag;//open选项
    char outbuffer[MAX];//缓冲区
    int bufferlen;//已用缓冲区长度
    int flush_method;//刷新选项
}MyFile;

MyFile *MyFopen(const char *path, const char* mode);
void MyFclose(MyFile*);
int MyFwrite(MyFile*, void *str, int len);
void MyFFlush(MyFile*);
